home *** CD-ROM | disk | FTP | other *** search
/ The Atari Compendium / The Atari Compendium (Toad Computers) (1994).iso / files / prgtools / programm.ing / sources.arc / DUNGMAIN.H < prev    next >
Encoding:
C/C++ Source or Header  |  1994-03-06  |  6.5 KB  |  241 lines

  1. /* last modified : august 8 1993 */
  2. /* note:
  3.      If you want to add more pics. ie add more wall pics. 
  4.      you NEED to check for the line
  5.  
  6.       if(check_for_new_pal > nn) then ...
  7.  
  8.     and change nn to the # of the LAST pic before
  9.     pic#27..(thats MISC3.dat) 
  10.     if you need to , change pick#27 to a higher #.. 
  11.     BUT also remember that you must change the 
  12.     HIT_TABLE array size (currently at a max of 0->27!!)
  13.     and you need to reinit it(its initialized in the 
  14.     module start() in t5.c
  15.  
  16. */
  17.  
  18. /*#define    Random()    (int)xbios(17)         
  19. extern    long    xbios();*/
  20. int hold_xy[8];   /* for other misc pix xy coords */
  21. #define rnd(t) abs(Random()%(t))   /*returns a number from 0 to (t-1) */
  22. int mssg_count=0;
  23. long time=0;  /* timekeeping */
  24. int way=1;   /*time*/
  25. int count=1;weather=0;
  26.                  /* 1st emtry is 1AM */
  27. int change[] = { 000,000,000,000,001,002,004,006,007,047,047,067,077,
  28.                  077,067,057,047,047,037,027,007,006,005,003,001
  29.                 };
  30. static char *weather_list[]={"Normal  ","Windy   ","Cool    ","Hot!    ","Rainy   ","Cold    ","Overcast"};
  31.  
  32. char n[40];
  33.  
  34. char    null[2] = {0,0} ;
  35.  
  36. /* savepal is the sys default pallette. 
  37.    newpal  is the games pallette #1
  38.   
  39.    pal4    is pal      for misc3.dat  (pic25)*/
  40. int savepal[16],newpal[16],junkbuff[46],pal4[16];
  41.  
  42. struct {
  43. unsigned int which_pal : 1;    /* 0 for sys, 1-3 for other */
  44.        } flags;
  45.  
  46. char     temp_[32001],                     /* Temp buffer where file is read in    */
  47.          *hld,
  48.          *iff_in, *iff_out;                  /* Pointers for DEGAS unpack() routine    */
  49.  
  50.  
  51.  
  52. int mode;
  53.  
  54.  
  55.  
  56. /*
  57.     Define VDI Global Variables
  58. */
  59. int contrl[12];
  60. int intin[256],  ptsin[256];
  61. int intout[256], ptsout[256];
  62.  
  63.    int i,filehandle;
  64.     int fd ;
  65.     
  66.     int x,z,w;
  67.     int y;
  68.  
  69.  
  70.  int     handle;     /*  Virtual Workstation Handle   */
  71.   char word[10];
  72.     char title[] ="MAIN_SCR.DAT";            /* declares an array that holds the string "MAIN.DAT/0" */ 
  73.     char pix1[] = "DMWALLS1.DAT";
  74.     char pix2[] = "DMWALLS2.DAT";
  75.     char pix3[] = "DMWALLS3.DAT";
  76.     char pix4[] = "DMWALLS4.DAT";
  77.     char pix5[] = "FLOOR1.DAT";
  78.     char pix6[] = "FLOOR2.DAT";
  79.     char pix7[] = "gate.DAT";
  80.  
  81.  
  82.  
  83.  
  84.  
  85.  
  86.  
  87.    
  88.  
  89.   
  90.  
  91. #define max_rooms 250                   /* its 249 rooms right now*/
  92.  
  93. /****************************************************************/
  94. #define max_x 27     /* o to 24  = 25 rooms*/
  95. #define max_y 27      /* 0 to 25   = 26 rooms */ 
  96.  
  97. struct field_data
  98.     {
  99.     int Field1,
  100.         Field2,
  101.         Field3,
  102.         Field4,
  103.         Field5,
  104.         Field6,
  105.         Field7,
  106.         floor;
  107.     };
  108.  
  109.  struct pic_data
  110.    {
  111.     struct field_data N,
  112.                       S,
  113.                       E,
  114.                       W;
  115.   
  116.    }roomrec[250];
  117.  
  118. struct stuff
  119.        {
  120.        int room;
  121.        int n,s,e,w;
  122.        };
  123.  
  124.        /* if more rooms added make this bigger!!!! (max x and y )*/ 
  125.        /* map[]  */
  126. #define ROOMS 300
  127.  struct stuff map[ROOMS];     
  128.  
  129.  char dir;
  130.   
  131.    int loc;   
  132.    long command;    
  133.     
  134.  
  135.  
  136.  
  137. char string[30];
  138.     
  139. int runner;
  140. int hrt[20];  /* the hit roll table allocation */
  141. int mhrt[20];  /* the hrt for monsters */
  142.  
  143. struct mon_
  144.         {
  145.         char name[20];
  146.         int ac;
  147.         int hd;
  148.         int hp;
  149.         int weapon;
  150.         int spell;
  151.         int lvl;
  152.         };
  153.  
  154. struct mon_ mon;  /* storage for the data of the monster you are fighting*/
  155.  
  156. struct mon_ monsters[51];  /* 0->50 monsters */ 
  157.  
  158.   /* stores the monsters, its an array of records!*/
  159.   /* to access hp. --->  MONSTERs[2].hp = xxx; */
  160.  
  161.  
  162. struct character
  163.         {
  164.          char name[15]; /* NO! Set these to char *name and then */
  165.          char align[15]; /* name = "blahh.." OR do char name[]="blah!" */
  166.          char class[15];  /* you're defining an array of one element */
  167.          int lvl;         /* thats a ptr to a char! too redundant! */
  168.          long int exp;
  169.          long int hp;
  170.          int ac,str,inte,wis,dex,con;
  171.          int weapon_num,armor_num;
  172.          int backpack[10];       /* holds unique #. I'll have 1 main array that will hold number,name so we can look it up */
  173.          char weapon[15];
  174.          char armor[15];
  175.          char spell[15];
  176.          long int max_hp,max_sp;
  177.          int spell_num;
  178.          long int sp;
  179.          long int gold;
  180.          int user_items[25];  /* holds food,h2o,keys,etc.. */
  181.          int current_spells_active[5]; /*0=treasure Finding, 1=Fleetness, 2=Protection
  182.                                          3=Strength 4=Charm */
  183.          int hunger_thurst_status[2];  /*0 not hungry/thirsty.. 10 FAMISHED */
  184.                                        /* 0 is hunger 1 is thirst */
  185.          long int bank_balance;  
  186.          int x_loc,y_loc,        /* current x,y location */
  187.              weather,count,way,time,loc,current_sky,
  188.              current_sound,clock,am_pm,sound;
  189.          char dir; 
  190.          };
  191.  
  192.  
  193.  struct character user;
  194.  
  195.    
  196.  int who_goes,mon_alive,char_alive,mon_num,mon_lvl;
  197.  
  198.  MFDB t_mf;
  199.  
  200. /* hit table declrations. */
  201. struct vm_table
  202.        {
  203.          int loaded;
  204.          int pix_lookup_cell;
  205.        };
  206. struct vm_table hit_table[31];   /* for virtual memory hit table[1] stands for pic
  207.                         1. If table[1] = 1 then pic 1 is in memory. If
  208.                         its =0 then its not in memory so a pic must be removed, and this 
  209.                         pic must be loaded into its place */
  210.  
  211. #define max_items 50      /* back pack lookup data structs */
  212. struct i_look
  213.        {
  214.         char name[15];
  215.         int points;          /*pts damage for this weapon */
  216.        }unique_item[max_items];
  217.  
  218. /* define street array */
  219. struct street_def
  220.      {
  221.       char street_name[15];  /*14 chars max! */
  222.       int  room;
  223.      }intersection[40];
  224. char street_hold[15];  /* hold streetname so after encounter,etc you*/
  225.                        /* can redisplay the street name  */
  226.  
  227. /* for sound invokage */
  228. long addr;                             /* Basepage addr of TSR prg */
  229.  
  230. int CURRENT_CLOUD;
  231. int CURRENT_SKY=0;       /* holds current value of sky color */
  232. int CURRENT_SOUND=0;     /* if 1-wind, 4-Rain, else no sound */
  233.  
  234. /* SOME TIME DEFS */ /* Initial time is 1pm in the afternoon */
  235. int clock=1;   /* when == 12 a clock tolls , also tells time of day */
  236. int am_pm=1;   /* if == 1 then its pm. at midnight change to am, at noon change to pm */
  237.  
  238. int cell = 0; /* the current room you are in */
  239.  
  240. int sound = 1; /* to turn sound on/off. default is ON */
  241.